package cc.mrbird.febs.common.annotation;

import cc.mrbird.febs.common.enums.FormatType;
import cc.mrbird.febs.common.validator.CronValidator;
import cc.mrbird.febs.common.validator.FormatValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = FormatValidator.class)
public @interface IsRightFormat {

    FormatType type();

    String message() default "格式不正确";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
